package com.yxq.mdt.app.modules.socialcontact.presenter;

import com.yxq.mdt.app.base.BasePresenter;
import com.yxq.mdt.app.modules.socialcontact.bean.SocialContactAllTopicsBean;
import com.yxq.mdt.app.modules.socialcontact.model.MainSocialContactModel;
import com.yxq.mdt.app.net.ApiModel;

public class MainSocialTopicsPresenter extends BasePresenter<MainSocialTopicsContract.View, MainSocialContactModel> implements MainSocialTopicsContract.Presenter {
    /**
     * 如果当前页面同时需要 Model 层和 View 层,则使用此构造函数(默认)
     *
     * @param rootView
     * @param model
     */
    public MainSocialTopicsPresenter(MainSocialTopicsContract.View rootView, MainSocialContactModel model) {
        super(rootView, model);
    }

    @Override
    public void getContactAllTopicsList() {
        mBaseModel.getContactAllTopicsList(new ApiModel.CommonCallback<SocialContactAllTopicsBean>() {
            @Override
            public void onSuccess(SocialContactAllTopicsBean socialContactAllTopicsBean) {
                mRootView.onContactAllTopicsSuccess(socialContactAllTopicsBean);
            }

            @Override
            public void onError(String errMsg) {
                mRootView.onContactAllTopicsFailed();
            }
        });
    }
}
